<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        function onclickway(){
            var a = document.getElementById("123");
            var b = document.getElementById("456");
            if (a.value == "123456"){
                b.innerHTML = "<img width=\"18\" heigh=\"18\" src=\"https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.51miz.com%2FElement%2F00%2F75%2F57%2F02%2F13d5b648_E755702_6ec47267.png%21%2Fquality%2F90%2Funsharp%2Ftrue%2Fcompress%2Ftrue%2Fformat%2Fpng%2Ffh%2F630&refer=http%3A%2F%2Fimg.51miz.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1640271099&t=aa197169c2fb3923d7a0a36cfd69e4b1\">";               
            }else{
                b.innerHTML = "<img width=\"18\" height=\"18\" src=\"https://tse1-mm.cn.bing.net/th/id/R-C.88a3a3ebb7c05f8b7fca954e2a618d22?rik=JeQbow4r9dkuIg&riu=http%3a%2f%2fpic.616pic.com%2fys_bnew_img%2f00%2f25%2f09%2fKUkpqiVLcf.jpg&ehk=cbrjaOeLH9pSZZF7f6HLsMeNgyzkvwN%2b%2bPLeno2t3sE%3d&risl=&pid=ImgRaw&r=0\">";
            }
        }
    </script>
    <style type="text/css">
        #id002{
            width: 500px;
            height: 500px;
            display:block;
            margin:0 auto;
            /* background-color: blue; */
        }
    </style>
</head>
<body>
    <div id="id002">
        用户密码：
        <input type="text" id="123" >
        <span id="456"></span>
        <input type="button" value="确定" onclick="onclickway();">
    </div>
</body>
</html>